package com.example.cloudconsumer;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

@SpringBootApplication
@EnableEurekaClient //开启Eureka服务发现
@EnableFeignClients //启用feign进行远程调用
public class CloudConsumerApplication  implements CommandLineRunner {

	public static void main(String[] args) {
		SpringApplication.run(CloudConsumerApplication.class, args);
	}


    @Value("${server.port}")
    private String env;

    @Override
    public void run(String... args) throws Exception {
        System.out.println("------------------获取配置中心-server.port:" + env);
    }
}
